package cc.catface.common.output;

/**自定义业务异常*/
public class BizException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String code;
    private String message;

    public BizException() {
        super();
    }

    public BizException(IBaseCode baseCode) {
        super(baseCode.getCode());
        this.code = baseCode.getCode();
        this.message = baseCode.getMessage();
    }

    public BizException(IBaseCode baseCode, Throwable cause) {
        super(baseCode.getCode(), cause);
        this.code = baseCode.getCode();
        this.message = baseCode.getMessage();
    }

    public BizException(String message) {
        super(message);
        this.message = message;
    }

    public BizException(String code, String message) {
        super(code);
        this.code = code;
        this.message = message;
    }

    public BizException(String code, String message, Throwable cause) {
        super(code, cause);
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
